package com.ror.java.se.parameters;

public class Demo01VariableParameter {
    public static void main(String[] args) {
        int sum = getSum(1, 2, 3, 4, 5);
        System.out.println(sum);
    }

    static int getSum(int a, int... nums) {
        System.out.println("1st num: " + a);
        int sum = a;
        for (int num : nums) {
            sum += num;
        }
        return sum;
    }
}
